#include <iostream>
#include<unordered_map>
using namespace std;




int main()
{
	unordered_map<string, int> mp;
    int n;
	cin >> n;
	while(n--)
	{
		string s;
		int op, x;
		cin >> op;
		if(op == 1)
		{
			cin >> s >> x;
			mp[s] = x;
			cout << "OK" << endl;
		}
		else if(op == 2)
		{
			cin >> s;
			if(mp.count(s))
			    cout << mp[s] << endl;
			else
			    cout << "Not found" << endl;
		}
		else if(op == 3)
		{
			cin >> s;
			if(mp.count(s))
			{
				 mp.erase(s);
				 cout << "Deleted successfully" <<endl;
			}
			    
			else
			    cout << "Not found" << endl;
		}
		else
		{
			cout << mp.size() << endl;
		 } 
	}
	return 0;
}
